package libs

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

type User struct {
	UserName string `json:"user_name"`
	Age      int
	Password string `json:"-"`
}

func ResponseJSON(c *gin.Context) {
	c.JSON(
		http.StatusOK,
		[]User{
			User{UserName: "李红", Age: 23},
			User{UserName: "李红2", Age: 23},
		},
	)
}

func ResponseRedirect(c *gin.Context) {
	c.Redirect(301, "https://www.baidu.com")
}
